package com.monboo.album.view.component
{
	import com.monboo.album.view.AlbumInfoMediator;
	import com.monboo.album.common.AlbumConst;
	
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLRequest;
	
	
	public class Theme extends AbstractChangeUI
	{
		private var _themeUrl:String;
		private var themeContent:Sprite;
		private var playerWidth:Number;
		private var playerHeight:Number;
		//private var imageInfo:AlbumInfoMediator;
		
		public function Theme(themeUrl:String,_imageInfo:AlbumInfoMediator){
			super(_imageInfo);
			_themeUrl = themeUrl;
			init();
		}
		
		private function init():void{
			playerWidth = AlbumConst.imageWidth;
			playerHeight = AlbumConst.imageHeight;
			
			themeContent = new Sprite();
			themeContent.name = "themeContent";
			addChild(themeContent);
			var load:Loader = new Loader();
			load.load(new URLRequest(_themeUrl));
			themeContent.addChild(load);
			
			load.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
			
		}
		
		private function loaded(e:Event):void{
			changeSize(themeContent);
			this.visible = true;
		}
	}
}